from matplotlib import pyplot as plt


def draw_summary_scatter_save(data):
    """
    绘图并保存
    :param data: DataFrame
    :return:
    """
    plt.figure(figsize=[21, 12], dpi=72)
    plt.xticks(rotation=90)
    x = data["group"]
    print(len(x), x)
    labels = data.columns.tolist()[3:]

    for label in labels:
        y = data[label]
        # print(len(y))
        plt.plot(x, y, label=label)
        plt.scatter(x, y, label=label)

    plt.title(title)
    plt.legend()
    absPath = os.path.abspath(path)
    exist_create_dir(absPath)
    log.info("the abs path of img save:" + absPath)
    plt.savefig(absPath)
    plt.clf()
    # plt.show()
